Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fleet] Fix upgrades for packages with restructured inputs #109887

Merged
merged 4 commits into from
Aug 25, 2021

Conversation

kpollich
Copy link
Member

@kpollich kpollich commented Aug 24, 2021

Summary

Addresses errors surfaced when testing upgrades from AWS 0.6.1 to 0.10.4. Namely, when inputs are removed from a package between versions we were initially throwing errors for each input in the new package that didn't exist on the outdated package version. Now, we instead simply skip over cases like this in which an input no longer exists on the new package version.

Screen Recording

Kapture 2021-08-24 at 13 03 32

I've also included a validation fix for when streams are removed that addresses issues with the Nginx package.

Fixes #109808
Fixes #109805

Addresses errors surfaced when testing upgrades from AWS 0.6.1 to 0.10.4.
Namely, when inputs are removed from a package between versions,we were
initially throwing errors for each input in the new package that didn't
exist on the outdated package version. Now, we instead simply skip over
cases like this in which an input no longer exists on the new package version.
@kpollich kpollich added v8.0.0 release_note:skip Skip the PR/issue when compiling release notes Team:Fleet Team label for Observability Data Collection Fleet team auto-backport Deprecated - use backport:version if exact versions are needed v7.15.0 labels Aug 24, 2021
@kpollich kpollich self-assigned this Aug 24, 2021
@kpollich kpollich requested a review from a team as a code owner August 24, 2021 17:09
@elasticmachine
Copy link
Contributor

Pinging @elastic/fleet (Team:Fleet)

Copy link
Contributor

@jen-huang jen-huang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any test coverage we can add for this case?

@kpollich
Copy link
Member Author

Any test coverage we can add for this case?

Good call. We should be able to add a test package version that incurs this case. I'll work on that this morning.

@kpollich
Copy link
Member Author

@jen-huang I added some basic test cases for input and policy template restructures in 5889928.

I think it'd be good to add some more robust assertions to these tests at some point rather than just asserting on success and error values. e.g. actually verifying the expected data in the updated policy objects. I added a tech debt issue to the backlog to capture that improvement: #110087

@kpollich kpollich enabled auto-merge (squash) August 25, 2021 16:00
@kpollich
Copy link
Member Author

@hop-dev - I wound up tracking down a fix for that cannot read property path of undefined issue we spoke about. I've included the fix here in this PR in 2efbaf6

Essentially, for package versions in which a stream was removed, we were incurring a validation error. This commit just updates our validation to tolerate this case as we do elsewhere.

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
fleet 454.4KB 454.4KB +15.0B

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @kpollich

@kpollich kpollich merged commit 99071ec into elastic:master Aug 25, 2021
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Aug 25, 2021
…09887)

* Fix upgrades for packages with restructured inputs

Addresses errors surfaced when testing upgrades from AWS 0.6.1 to 0.10.4.
Namely, when inputs are removed from a package between versions,we were
initially throwing errors for each input in the new package that didn't
exist on the outdated package version. Now, we instead simply skip over
cases like this in which an input no longer exists on the new package version.

* Add basic test cases for restructured packages
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Aug 25, 2021
…09887)

* Fix upgrades for packages with restructured inputs

Addresses errors surfaced when testing upgrades from AWS 0.6.1 to 0.10.4.
Namely, when inputs are removed from a package between versions,we were
initially throwing errors for each input in the new package that didn't
exist on the outdated package version. Now, we instead simply skip over
cases like this in which an input no longer exists on the new package version.

* Add basic test cases for restructured packages
@kibanamachine
Copy link
Contributor

💚 Backport successful

Status Branch Result
7.15
7.x

The backport PRs will be merged automatically after passing CI.

kibanamachine added a commit that referenced this pull request Aug 25, 2021
…110150)

* Fix upgrades for packages with restructured inputs

Addresses errors surfaced when testing upgrades from AWS 0.6.1 to 0.10.4.
Namely, when inputs are removed from a package between versions,we were
initially throwing errors for each input in the new package that didn't
exist on the outdated package version. Now, we instead simply skip over
cases like this in which an input no longer exists on the new package version.

* Add basic test cases for restructured packages

Co-authored-by: Kyle Pollich <[email protected]>
kibanamachine added a commit that referenced this pull request Aug 25, 2021
…110149)

* Fix upgrades for packages with restructured inputs

Addresses errors surfaced when testing upgrades from AWS 0.6.1 to 0.10.4.
Namely, when inputs are removed from a package between versions,we were
initially throwing errors for each input in the new package that didn't
exist on the outdated package version. Now, we instead simply skip over
cases like this in which an input no longer exists on the new package version.

* Add basic test cases for restructured packages

Co-authored-by: Kyle Pollich <[email protected]>
@kpollich kpollich deleted the aws-package-upgrade-fixes branch August 26, 2021 12:08
@amolnater-qasource
Copy link

Hi @EricDavisX
We are validating this PR in lieu of reported issue at #109805
We have revalidated this on 7.15.0 BC-3 and found it fixed now.

Observations:

  • We are now able to upgrade Nginx v0.2.4 to v0.7.0 on 7.15.0 BC Kibana.

Build details:
Build 43818
Commit: 6f7562b

Screen Recording:

New.Policy.for.Nginx.test.-.Agent.policies.-.Fleet.-.Elastic.-.Google.Chrome.2021-08-31.12-13-42.mp4

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Deprecated - use backport:version if exact versions are needed release_note:skip Skip the PR/issue when compiling release notes Team:Fleet Team label for Observability Data Collection Fleet team v7.15.0 v7.16.0 v8.0.0
Projects
None yet
5 participants